<include file="public@header" />
</head>

<body>
    <div class="wrap">
        <ul class="nav nav-tabs">
            <li class="active"><a>设备列表</a></li>
            <li class=""><a href="{:url('admin/device/add')}">添加设备</a></li>
        </ul>
        <div class="well form-inline margin-top-20" style="height: 100px;">
            <form class="" method="post" action="{:url('admin/device/index')}" style="float: left;width: 45%">
                <input type="hidden" name="type" value="imei">
                <!-- 用户ID：
        <input class="form-control" type="text" name="uid" style="width: 200px;" value="{:input('request.uid')}"
               placeholder="请输入用户ID"> -->
                imei:
                <input class="form-control" type="text" name="keyword" style="width: 200px;"
                    value="{:input('request.keyword')}" placeholder="imei">
                <input type="submit" class="btn btn-primary" value="搜索" />
                <!-- <a class="btn btn-danger" href="{:url('admin/device/index')}">清空</a> -->
            </form>
            <form class="" method="post" action="{:url('admin/device/index')}" style="float: left;">
                <input type="hidden" name="type" value="user">
                <!-- 用户ID：
        <input class="form-control" type="text" name="uid" style="width: 200px;" value="{:input('request.uid')}"
               placeholder="请输入用户ID"> -->
                用户名:
                <input class="form-control" type="text" name="keyword" style="width: 200px;"
                    value="{:input('request.keyword')}" placeholder="用户名">
                <input type="submit" class="btn btn-primary" value="搜索" />
                <!-- <a class="btn btn-danger" href="{:url('admin/device/index')}">清空</a> -->
            </form>
        </div>
        <form method="post" class="js-ajax-form">
            <table class="table table-hover table-bordered">
                <thead>
                    <tr>
                        <th>ID</th>
                        <th>IMEI</th>
                        <th>有效时间</th>
                        <!-- <th>宠物号码</th> -->
                        <!-- <th>设备型号</th> -->
                        <th>联系人</th>
                        <th>联系人电话</th>
                        <th>设备电话</th>
                        <th>设备名称</th>
                        <th>创建时间</th>
                        <th>绑定用户</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <foreach name="list" item="vo">
                        <tr>
                            <td>{$vo.id}</td>
                            <td>{$vo.imei}</td>
                            <td>{:date('Y年m月d日',$vo.effect_time)}</td>
                            <!-- <td>{$vo.pet_number}</td> -->
                            <!-- <td>{$vo.type}</td> -->
                            <td>{$vo.contract}</td>
                            <td>{$vo.contract_phone}</td>
                            <td>{$vo.device_phone}</td>
                            <td>{$vo.device_name}</td>
                            <td>{$vo.create_time}</td>
                            <td>{$vo.username}</td>
                            <td>
                                <if condition="($vo.status == 1) "> 开启
                                    <else /> 关闭
                                </if>
                            </td>
                            <td>
                                <!--<neq name="vo.id" value="1">-->
                                <!--<empty name="vo.user_status">-->
                                <!--<a href="{:url('adminIndex/cancelban',array('id'=>$vo['id']))}"-->
                                <!--class="js-ajax-dialog-btn"-->
                                <!--data-msg="{:lang('ACTIVATE_USER_CONFIRM_MESSAGE')}">{:lang('ACTIVATE_USER')}</a>-->
                                <!--<else/>-->
                                <!--<a href="{:url('adminIndex/ban',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn"-->
                                <!--data-msg="{:lang('BLOCK_USER_CONFIRM_MESSAGE')}">{:lang('BLOCK_USER')}</a>-->
                                <!--</empty>-->
                                <!--<else/>-->
                                <!--<a style="color: #ccc;">{:lang('BLOCK_USER')}</a>-->
                                <!--</neq>-->
                                <a href="{:url('admin/device/edit',array('id'=>$vo['id']))}" class="js-ajax-btn"
                                    data-msg="">编辑</a>
                                <a href="{:url('admin/device/deleteDevice',array('id'=>$vo['id']))}"
                                    class="js-ajax-dialog-btn" data-msg="">删除</a>
                                <if condition="$vo['user_id'] != null">
                                    <a href="{:url('admin/device/unbindDevice',array('device_id'=>$vo['device_id'], 'uid'=>$vo['user_id']))}"
                                        class="js-ajax-dialog-btn" data-msg="">解绑</a>
                                </if>
                            </td>
                        </tr>
                    </foreach>
                </tbody>
            </table>
            <div class="pagination">{$page}</div>
        </form>
    </div>
    <script src="__STATIC__/js/admin.js"></script>
</body>

</html>